package com.xiaoying.server.publish.entity;

import java.io.Serializable;

/**
 * 
 * @author ZJD
 *
 */
public class UploadResult implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * 上传结果类型
	 
	 */
	public static final int TYPE_SUCCESS=0x00;
	/**
	 * 末尾为1，上传失败
	 */
	public static final int TYPE_FAIL=0x01;
	
	/**
	 * 上传失败：次数过多
	 */
	public static final int TYPE_FAIL_COUNT_EXCEED=0x11;
	
	private int id;
	private String fileName;
	private long fileSize;
	private short fileType;
	private String remotePath;
	private String filePath;	
	private String uploadDt;
	private String receiveDt;		//接收到的消息时间
	private int uploadCount;		//上传的次数
	
	/**
	 * resultType 0=正常上传成功 0x01=上传失败  0x11=上传次数过多
	 */
	private int resultType;
	
	// Default Constructor
	public UploadResult(){
		
	}
	
	
	// Constructor with FileInfo and remotePath and resultType
	public UploadResult(FileInfo fileInfo,String remotePath,int resultType) {
		this.fileName = fileInfo.getFileName();
		this.fileSize = fileInfo.getFileSize();
		this.fileType = fileInfo.getFileType();
		this.resultType = resultType;
		this.remotePath = remotePath;
		this.filePath = fileInfo.getFilePath();
		this.resultType = TYPE_SUCCESS;
		this.receiveDt = fileInfo.getReceiveDt();
		this.uploadCount = fileInfo.getUploadCount();
	}	
	
	// Success Constructor with FileInfo and remotePath
	public UploadResult(FileInfo fileInfo,String remotePath) {
		this.fileName = fileInfo.getFileName();
		this.fileSize = fileInfo.getFileSize();
		this.fileType = fileInfo.getFileType();
		this.remotePath = remotePath;
		this.filePath = fileInfo.getFilePath();
		this.resultType = TYPE_SUCCESS;
		this.receiveDt = fileInfo.getReceiveDt();
		this.uploadCount = fileInfo.getUploadCount();
	}
	
	// Success Constructor with FileInfo and remotePath
	public UploadResult(FileInfo fileInfo) {
		this.fileName = fileInfo.getFileName();
		this.fileSize = fileInfo.getFileSize();
		this.fileType = fileInfo.getFileType();
		this.filePath = fileInfo.getFilePath();
		this.resultType = TYPE_SUCCESS;
		this.receiveDt = fileInfo.getReceiveDt();
		this.uploadCount = fileInfo.getUploadCount();
	}
	

	
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getRemotePath() {
		return remotePath;
	}

	public void setRemotePath(String remotePath) {
		this.remotePath = remotePath;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public long getFileSize() {
		return fileSize;
	}

	public void setFileSize(long fileSize) {
		this.fileSize = fileSize;
	}

	public short getFileType() {
		return fileType;
	}

	public void setFileType(short fileType) {
		this.fileType = fileType;
	}

	public int getResultType() {
		return resultType;
	}

	public void setResultType(int resultType) {
		this.resultType = resultType;
	}

	public String getFilePath() {
		return filePath;
	}

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}

	public String getUploadDt() {
		return uploadDt;
	}

	public void setUploadDt(String uploadDt) {
		this.uploadDt = uploadDt;
	}

	public String getReceiveDt() {
		return receiveDt;
	}

	public void setReceiveDt(String receiveDt) {
		this.receiveDt = receiveDt;
	}

	public int getUploadCount() {
		return uploadCount;
	}

	public void setUploadCount(int uploadCount) {
		this.uploadCount = uploadCount;
	}
	
	
	
}
